# -*- coding: utf-8 -*-
from scrapy.selector import Selector
import scrapy
from scrapy.loader import ItemLoader, Identity
import article.items

class huobiSpider(scrapy.Spider):
    name = "huobi"
    allowed_domains = ["huobi.pro"]
    start_urls = (
        'https://www.huobi.pro/zh-cn/notice/',
    )

    def parse(self, response):
        sel = Selector(response)
        print(sel)
        # for link in sel.xpath('//h2/a/@href').extract():
        #     request = scrapy.Request(link, callback=self.parse_item)
        #     yield request
        #
        # pages = sel.xpath("//div[@class='navigation']/div[@id='wp_page_numbers']/ul/li/a/@href").extract()
        # print('pages: %s' % pages)
        # if len(pages) > 2:
        #     page_link = pages[-2]
        #     page_link = page_link.replace('/a/', '')
        #     request = scrapy.Request('http://www.huobi.com/a/%s' % page_link, callback=self.parse)
        #     yield request

    def parse_item(self, response):
        pass
